package behaviorType.chainOfResponsibility;

public class Main {

    public static void main(String[] args) {
        // 先要组装责任链
        IHandler generalHandler = new GeneralManager();
        IHandler deptHandler = new DeptManager();
        IHandler projecthanHandler = new ProjectManager();

        projecthanHandler.setHandler(deptHandler);
        deptHandler.setHandler(generalHandler);

        // 开始测试
        String test1 = projecthanHandler.handleFeeRequest("张三", 300);
        System.out.println("test1 = " + test1);
        String test2 = projecthanHandler.handleFeeRequest("李四", 300);
        System.out.println("test2 = " + test2);
        System.out.println("---------------------------------------");

        String test3 = projecthanHandler.handleFeeRequest("张三", 700);
        System.out.println("test3 = " + test3);
        String test4 = projecthanHandler.handleFeeRequest("李四", 700);
        System.out.println("test4 = " + test4);
        System.out.println("---------------------------------------");

        String test5 = projecthanHandler.handleFeeRequest("张三", 1500);
        System.out.println("test5 = " + test5);
        String test6 = projecthanHandler.handleFeeRequest("李四", 1500);
        System.out.println("test6 = " + test6);
    }

}